package com.itheima.test5;

public class Test {

    public static void main(String[] args) {
       /* Zi zi= new Zi();
        zi.sing();
       Fu fu= new Zi();
       fu.sing();*/
       Fu fu= new Fu() {
            @Override
            public void sing() {
                System.out.println("这是匿名内部类的sing");
            }

           @Override
           public void jump() {
               System.out.println("这是匿名内部类的jump");
           }
       };
       fu.sing();
       fu.jump();;
       new Fu(){
           public void sing(){
               System.out.println("只因你太美");
           }

           @Override
           public void jump() {
               System.out.println("跳一曲");
           }
       }.sing();
        Student student = new Student();
        student.study();
        new Student(){
            public void study(){
                System.out.println("不爱学习,爱玩耍");
            }
        }.study();
    }

}
abstract  class Fu{


    public abstract void sing();
    public abstract void jump();
}

class Student{

    public void study(){
        System.out.println("爱学习");

    }
}
